package com.zthz.douxing.msg

/**
 * Created by zsw on 6/21/14.
 *
 * 第三方返回状态码对应的具体内容保存类的基类
 */
class DouXingMessageResult {

    private static HashMap<? extends Object,String> resultCotent

    public DouXingMessageResult(){}

    public DouXingMessageResult(HashMap<? extends Object,String> resultCotent) {
        this.resultCotent = resultCotent
    }

    public String getSendStatus(Object key){

        if (key instanceof String){//getui返回的状态码是小写 官网对应的描述的状态码大写 转换下
            for(String tkey : resultCotent.keySet()) {
                if(tkey.equalsIgnoreCase(key)){
                    key = tkey
                    break
                }
            }
        }

        String desc = resultCotent.get(key)
        if(desc)
            return "code : ${key},desc:${desc}"
        else
            return "code : ${key},desc:未找到该状态码的具体描述"
    }
}
